package com.oglvip.business.dto;

import lombok.Data;

/**
 * @auther hanchao
 * @date 2016/12/24 18:34
 */
@Data
public class DeliveryFormDto {
    private String ticket;
    private Integer delivery;
    private Integer deliveryPrice;
    private Integer startDeliveryPrice;
    private Integer freeShip;
    private Integer deliveryDistance;

    /**
     * 单位换算
     * @return
     */
    public DeliveryFormDto transferDto(){
        if(this.getDeliveryPrice() != null){
            this.setDeliveryPrice(this.getDeliveryPrice() * 100);
        }
        if(this.getStartDeliveryPrice() != null){
            this.setStartDeliveryPrice(this.getStartDeliveryPrice() * 100);
        }
        if(this.getFreeShip() != null){
            this.setFreeShip(this.getFreeShip() * 100);
        }
        return this;
    }
}
